function getQueryStringByName(str) {
  var href = location.href.split('?').pop().split('&')
  for(var i=0, l=href.length; i<l; i++) {
    var query = href[i].split('=')
    var queryName = query.shift()
    if(queryName == str) {
      return query.pop()
    }
  }
}
var id = getQueryStringByName('id')
console.log(id)
$.get('/ajax/book?id=' + id, function(d) {
  new Vue({
    el: '#app',
    data: d,
    methods: {
      readBook() {
        location.href = '/reader'
      }
    }
  })

},'json')
